import { bg_image } from "./indoorConfig.js";
import {getMerchantInfo,} from "../api/home/index.js"
export default {
	data() {
		return {
			bg_image,
			data:{},
		}
	},
	onReady() {
		this.getDetail()
	},
	onShow(){
		this.getDetail()
	},
	onPullDownRefresh(){//页面下拉刷新
		this.getDetail()
		uni.stopPullDownRefresh();
	},
	methods: {
		async fetchSomething(query){
			this.getDetail()
		},
		async getDetail(){
			let res = await getMerchantInfo()
			this.data = res.data||{}
			uni.setStorageSync('merchantId', this.data.id);
		},
		go(url) {
			uni.navigateTo({
				url:`${url}?merchantId=${this.data.id}`
			})
		},
		handleRecharge(){
			uni.navigateTo({
				url:`/pages/indoor/topup`
			})
		}
	}
}